package fields;

import translate.Translate;
import gstd.Player;

public class Territory extends Ownable {

	private int rent;

	public Territory(String name, int rent, int price) {
		super(name, price);
		this.rent = rent;
	}

	public int getRent() {
		return rent;
	}

	@Override
	public void landOnField(Player player) {
		buyField(player);
		if (getOwner() != null && getOwner() != player) {
			player.getInventory().addBalance(-rent);
			super.getOwner().getInventory().addBalance(rent);
		}
	}

	@Override
	public String toString() {
		return super.toString() + Translate.print("Rent: %d", this.getRent());
	}
}
